/**
*   \file   Ray.h
*   \author Dave Reid
*   \brief  Header file for the Ray shape.
*/
#ifndef __EAGL_RAY_H_
#define __EAGL_RAY_H_


namespace eagl
{

/**
*   \brief  Class representing a Ray.
*
*   A Ray consists of an origin (start point) and a direction. It is essentially
*   a line of infinite length.
*/
class Ray
{
public:

    /**
    *   \brief  Default constructor.
    */
    Ray() : m_origin(0.0f, 0.0f, 0.0f), m_direction(0.0f, 0.0f, 1.0f)
    {
    }

    /**
    *   \brief  Copy constructor.
    */
    Ray(const Ray &Ray) : m_origin(Ray.getOrigin()), m_direction(Ray.getDirection())
    {
    }

    /**
    *   \brief           Constructor.
    *   \param  pos [in] The new position of the Ray.
    *   \param  dir [in] The new direction of the Ray.
    */
    Ray(const vec3 &origin, const vec3 &dir) : m_origin(origin), m_direction(dir)
    {
    }

    /**
    *   \brief  Retrieves the origin of the Ray.
    *   \return The origin of the Ray.
    */
    const vec3 & getOrigin() const
    {
        return this->m_origin;
    }

    /**
    *   \brief  Sets the origin of the Ray.
    *   \param  pos [in] The new origin of the Ray.
    */
    void setOrigin(const vec3 &origin)
    {
        this->m_origin = origin;
    }

    /**
    *   \brief  Retrieves the direction of the Ray.
    *   \return The direction of the Ray.
    */
    const vec3 & getDirection() const
    {
        return this->m_direction;
    }

    /**
    *   \brief  Sets the position of the Ray.
    *   \param  pos [in] The new position of the Ray.
    */
    void setDirection(const vec3 &dir)
    {
        this->m_direction = dir;
    }


private:

    /// The position of the Ray.
    vec3 m_origin;

    /// The direction of the Ray.
    vec3 m_direction;
};

}

#endif  // __EAGL_RAY_H_